<!--#layout("/common/page.html",{"jsBase":"/js/"}){  -->
<div class="layui-container">
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
		<legend>注册</legend>
	</fieldset>

	<form class="layui-form" action="#" lay-filter="memberRegForm" method="post">
		<div class="layui-form-item">
			<label class="layui-form-label">输入手机号</label>
			<div class="layui-input-inline">
				<input type="text" name="phone" id="phone" lay-filter="phone" value="18663765675" lay-verify="required" autocomplete="off" placeholder="请输入手机号" lay-reqText="请输入手机号码" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">昵称</label>
			<div class="layui-input-inline">
				<input type="text" name="userName" lay-verify="required" autocomplete="off" value="格打" placeholder="请输入昵称" lay-reqText="请输入昵称" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">验证码</label>
			<div class="layui-input-inline">
				<input type="text" name="verifyCode" lay-verify="required" id="verifyCode" value="" autocomplete="off" placeholder="请输入图形码" lay-reqText="请输入图形码" class="layui-input">
			</div>
			<div class="layui-form-mid" style="padding: 0 !important;">
				<img id="img" src="/image" />
			</div>
		</div>
		<!--# if (false) {  -->
		<div class="layui-form-item">
			<label class="layui-form-label">验证码</label>
			<div class="layui-input-inline">
				<input type="text" name="phoneVerifyCode" lay-verify="required" autocomplete="off" value="1" placeholder="请输入手机短信验证码" lay-reqText="请输入手机短信验证码" class="layui-input">
			</div>
			<div class="layui-form-mid" style="padding: 0 !important;">
				<button type="button" class="layui-btn layui-btn-normal" id="FLY-getvercode">获取验证码</button>
			</div>
		</div>
		<!--# }  -->
		<div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-inline">
				<input type="password" name="repassword" value="123123" placeholder="请输入密码" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">确认密码</label>
			<div class="layui-input-inline">
				<input type="password" name="password" value="123123" placeholder="请再次输入密码" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">所在地区</label>
			<layui:areaSelect style='' itemId="area"></layui:areaSelect>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-inline">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="">立即提交</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	$(function() {
		$("#img").click(function() {
			changeImg();
		});
		function changeImg() {
			// var img = document.getElementById("img");
			$("#img").attr("src", "/image?date=" + new Date().getTime());
		}

		$("#verifyCode").blur(function() {
			$.post("/validVeirfyCode", {
				code : $(this).val()
			}, function(data) {
				console.log(data);
			});
		});
	})
</script>
<script>
layui.use(['form','layer','element'], function(){
	var form = layui.form;
	var $ = layui.$;
	form.on('submit(memberRegForm)', function(){
		var f = this;
		Lib.submitForm("${ctxPath}/member/reg.json",$(f),{},function(data) {
			console.info(data);
			//Common.info("更新成功");
		})
		return false;
    });
});
</script>
<!--#}  -->
